package com.itheima.cart.mapper;

import com.itheima.cart.pojo.ShoppingCart;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {


    void add(ShoppingCart shoppingCart);


    @Delete("delete from shopping_cart where user_id=#{userId} ")
    void clean(Long userId);



    @Update("update shopping_cart set number=#{number} where dish_id=#{dishId} or setmeal_id=#{setmealId}")
    void update(ShoppingCart cart);

    List<ShoppingCart> getByDishIdOrSetmealIdWithUserId(ShoppingCart shoppingCart);


    void deleteByDishId(ShoppingCart cart);
}
